<template>
  <l-pulldown
    :refresh="onRefresh"
  >
    <div v-for="item in 8" :key="item">
      <h1>Home</h1>
      <div class="box" />
      <van-button type="primary" @click="$toast('哈哈')">哈哈-{{ item }}</van-button>
    </div>
  </l-pulldown>
</template>

<script>
import { Button } from 'vant'
export default {
  components: {
    [Button.name]: Button
  },
  methods: {
    onRefresh() {
      return new Promise((resolve, reject) => {
        setTimeout(() => {
          console.log('refresh')
          resolve(true)
        }, 2000)
      })
    }
  }
}
</script>

<style lang="less" scoped>
.box{
  width: 100px;
  height: 100px;
  background-color: #f00;
}
</style>
